<template>
	<view>
		<u-sticky bgColor="#fff">
			<u-navbar :fixed="false" :placeholder="true" title="申请成功" @leftClick="leftClick" bgColor="#0F53AC"
				leftIconColor="#fff">
			</u-navbar>
		</u-sticky>
		<view class="box">
			<image class="myImg" src="@/static/images/user/yiwancheng.png"></image>
			<view class="tigs">申请成功</view>
			<view class="tigs2">试用申请已成功，您可以通过账号、密码登录智督云</view>
			<view class="tigs2" style="margin-bottom: 32rpx;">小程序及PC端进行体验</view>
			<view class="tigs3">
				<view class="tiggg tiggg1">试用到期时间：<span class="tiggg2">{{userData.expireDate}}</span></view>
				<view class="tiggg">用户PC端地址：<span class="tiggg2">https://zdyee.hnhuicha.com/pc/user/login</span><span style="margin-left: 32rpx;" @click="copyOrderNum">复制</span></view>
			</view>
			<view class="tigs4">提示：PC端地址可在【我的-关于我们】中查看</view>
			<view class="btn" @tap="handleLogin">立即体验</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userData:{}
			}
		},
		onShow() {
			this.getUserInfo()
		},
		methods: {
			getUserInfo() {
				this.userData = uni.getStorageSync('userInfo');
			},
			leftClick() {
				uni.reLaunch({
					url: '/pages/subPackagesD/login/index'
				})
			},
			handleLogin(){
				
				uni.$u.http.get('/base/mobile/sysMenuInfo/getMobileMenuListByRole').then(res => {
					if (res.code == 0) {
						if (res.data && res.data.length >= 0) {
							uni.setStorageSync('menu', res.data);
						}
						setTimeout(() => {
							uni.switchTab({
								url: '/pages/work/index'
							})
						}, 500)
					}
				}).catch(error => {
					uni.$u.toast(error)
				})
			},
			copyOrderNum() {
				uni.setClipboardData({
					data: 'https://zdyee.hnhuicha.com/pc/user/login',
					success: function () {
						uni.$u.toast('复制成功')
					},
					fail:function () {
						console.log('error');
					},
				});
			}
		},
	}
</script>

<style lang="scss" scoped>
	.box {
		padding: 32rpx;
		display: flex;
		flex-direction: column;
		align-items: center;

		.myImg {
			width: 160rpx;
			height: 160rpx;
			margin-top: 196rpx;
		}

		.tigs {
			font-size: 32rpx;
			color: #4D4D4D;
			margin: 48rpx 0 16rpx;
		}
		.tigs2 {
			font-size: 28rpx;
			color: #666666;
		}
		.tigs3{
			width: 100%;
			background-color: #F2F2F2;
			padding: 32rpx 0;
			color: #666666;
			font-size: 28rpx;
			margin-bottom: 60rpx;
			border-radius: 4px;
			.tiggg{
				margin-left: 32rpx;
			}
			.tiggg1{
				margin-bottom: 16rpx;
			}
			.tiggg2{
				color: #0F53AC;
			}
			
		}
		.tigs4{
			width: 100%;
			font-size: 28rpx;
			color: #999999;
			margin-bottom: 18rpx;
		}

		.btn {
			width: 100%;
			height: 92rpx;
			background-color: #0F53AC;
			border-radius: 12rpx;
			color: #fff;
			font-size: 34rpx;
			display: flex;
			justify-content: center;
			align-items: center;
		}
	}
</style>
